package com.jzx.provider.cv.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.util.Date;

/**
 * 简历索引
 */
@Data
@Builder
@Document(indexName = "cv", type = "cv", shards = 5, replicas = 1, refreshInterval = "-1")
public class CvIndex {
    @Id
    private String id;

    private Integer sex;

    /**
     * 身份、手机、邮箱验证 000:都未验证 101:身份和邮箱已验证
     */
    @Field(type = FieldType.Keyword)
    private String isCheck;

    /**
     * 简历关键词 以逗号隔开
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String cvKeywords;

    /**
     * 目前所在公司
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String nowCompany;

    /**
     * 目前所在行业
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String nowVocation;

    /**
     * 所在地区
     */
    @Field(type = FieldType.Keyword)
    private String nowLocation;

    /**
     * 期望工作地点
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String forwardCities;

    /**
     * 目前title
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String nowTitle;

    private Integer switchStatus;

    /**
     * 期望薪资
     */
    private Integer forwardSalary;

    /**
     * 教育信息
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String educationInfos;

    /**
     * 第一学历 see {@link com.jzx.provider.cv.constants.Education}
     */
    private Integer firstEdu;

    /**
     * 第一学历是否211 和985
     * 0 都不是 1:211 2:985
     */
    private Integer is211Or985ForFirst;

    /**
     * 最高学历 see {@link com.jzx.provider.cv.constants.Education}
     */
    private Integer edu;

    /**
     * 0 都不是 1:211 2:985
     */
    private Integer is211Or985ForUp;

    /**
     * 工作信息
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String workInfos;

    /**
     * 生日
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date birthDay;

    /**
     * 开始工作时间
     */
    @Field(type = FieldType.Keyword)
    private String startWorkDate;

    private Integer maritalStatus;

    /**
     * 简历更新时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
}
